﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace PSE.Communication.Fix.Common
{
    public class RepositoryManager
    {
        public static IRepositoryProvider GetRepositoryProvider()
        {
            FixConfigurationSection configSection = (FixConfigurationSection)ConfigurationManager.GetSection("fixConfiguration");

            if (configSection != null)
            {
                return ProviderLoader<IRepositoryProvider>.LoadProvider(configSection.Providers, "repositoryProvider");
            }
            else
            {
                throw new Exception("Section fixConfiguration not found in the config file");
            }
        }
    }
}